package com.mars.admin.modules.post.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mars.admin.modules.base.entity.BaseEntity;
import com.mars.admin.framework.listener.EntityChangeListener;
import com.mybatisflex.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 举报记录实体类
 *
 * @author Mars
 * @version 1.0
 * @date 2025-01-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@Table(value = "tb_report", onInsert = EntityChangeListener.class, onUpdate = EntityChangeListener.class)
@Schema(description = "举报记录")
public class Report extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 举报ID
     */
    @Id(keyType = KeyType.Auto)
    @Schema(description = "举报ID", example = "1")
    private Long id;

    /**
     * 举报用户ID
     */
    @Schema(description = "举报用户ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
    @Column("reporter_id")
    private Long reporterId;

    /**
     * 被举报用户ID
     */
    @Schema(description = "被举报用户ID", example = "2")
    @Column("reported_user_id")
    private Long reportedUserId;

    /**
     * 举报对象类型
     */
    @Schema(description = "举报对象类型：1-帖子，2-评论，3-用户", example = "1")
    @Column("target_type")
    private Integer targetType;

    /**
     * 举报对象ID
     */
    @Schema(description = "举报对象ID", example = "1")
    @Column("target_id")
    private Long targetId;

    /**
     * 举报类型
     */
    @Schema(description = "举报类型：1-垃圾信息，2-违法违规，3-不当内容，4-侵权，5-其他", example = "1")
    @Column("report_type")
    private Integer reportType;

    /**
     * 举报原因
     */
    @Schema(description = "举报原因", example = "发布不当内容", requiredMode = Schema.RequiredMode.REQUIRED)
    @Column("reason")
    private String reason;

    /**
     * 举报描述
     */
    @Schema(description = "举报描述", example = "详细的举报说明")
    @Column("description")
    private String description;

    /**
     * 证据图片
     */
    @Schema(description = "证据图片", example = "[\"https://example.com/1.jpg\"]")
    @Column("evidence_images")
    private String evidenceImages;

    /**
     * 举报IP
     */
    @Schema(description = "举报IP", example = "192.168.1.1")
    @Column("reporter_ip")
    private String reporterIp;

    /**
     * 处理状态
     */
    @Schema(description = "处理状态：0-待处理，1-已处理，2-已驳回", example = "0")
    @Column("status")
    private Integer status;

    /**
     * 处理结果
     */
    @Schema(description = "处理结果", example = "已删除违规内容")
    @Column("handle_result")
    private String handleResult;

    /**
     * 处理人ID
     */
    @Schema(description = "处理人ID", example = "1")
    @Column("handler_id")
    private Long handlerId;

    /**
     * 处理时间
     */
    @Schema(description = "处理时间", example = "2024-01-01 12:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column("handle_time")
    private LocalDateTime handleTime;
} 